<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<!-- 开发环境版本，包含了有帮助的命令行警告 -->
	<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	<title></title>
	
</head>
<body>
	<div id="app">
		<comp></comp>
	</div>
	
	
	<script type="text/javascript">
		let comp=Vue.extend({
			template:`
			<div>
				<h2>数据中的msg：{{msg}}</h2>
			</div>`,
			data(){
				return {
					msg:"我是组件中的msg"
				}
			}
		})
		
		var app=new Vue({
			el:"#app",
			data:{
				msg:"哈哈" //这个msg是在组件上调用不到的
			},
			components:{
				comp
			}
		})
		
	</script>
</body>
</html>